package org.example.scoredata;

import org.example.Server;

public class CountScore {
    int score = 0;
    public int count(int testPaper , String ans){
        String Tans = ans.substring(7,12);
        System.out.println(Tans);
        for (int i = testPaper; i < testPaper + 5; i++) {
            String r_ans = Server.topicarrayList.get(i).getAns();
            if (r_ans.equals(String.valueOf(Tans.charAt(i - testPaper)))){
                score += 20 ;
            }
        }
        System.out.println(score);
        return score;
    }
}
